<xsl:stylesheet version="2.0" xmlns:foo="http://something" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">

	<xsl:import href="/apps/engine/utils/translate_fct.xsl"/>

	<xsl:template match="/">
		<html>
			<head>
				<!--<xhtml:link rel="stylesheet" type="text/css" href="/views/css/orbeon-forms.css" />-->

				<title>
					<xsl:value-of select="/data/appname"/>
					<xsl:if test="/data/copName != ''"> - <xsl:value-of select="/data/copName"/>
					</xsl:if>
				</title>
				<link rel="stylesheet" type="text/css" href="/views/css/admin.css"/>
				<!-- JQuery -->
				<script type="text/javascript" src="../../js/jquery/jquery.js"/>
				<script type="text/javascript">
					<![CDATA[
						/* add an hover effect for the widget divs */
						$(document).ready(function(){
							
							/* div mouseover effects */
							$('.widget').mouseover( function(){
								$(this).addClass('hover');
							}); 
							
							/* div mouseout effects */
							$('.widget').mouseout( function(){
								$(this).removeClass('hover');
							});
							
							/* div mark effects */
							$('.widget').click( function(){
								$('.widget').removeClass('marked');
								$(this).addClass('marked');
							});
							
							/* authentication controls */
							$('a.authenticationOption').click(function(){
								$('div.container').hide("slow");
								$('#authenticationContainer_'+this.id.substr(2)).show("slow");
							});
							
							/* authentication form cancel buttons */
							$('div.authentication input[@type=reset]').click(function(){
								$('div.authentication').hide("slow");
							});
							
							/* visibility controls */
							$('a.visibleOption').click(function(){
								$('div.container').hide("slow");
								$('#visibilityContainer_'+this.id.substr(2)).show("slow");
							});
							
							/* visibility form cancel buttons */
							$('div.visibility input[@type=reset]').click(function(){
								$('div.visibility').hide("slow");
							});
							
							/* edit controls */
							$('a.editOption').click(function(){
								$('div.container').hide("slow");
								$('#editContainer_'+this.id.substr(2)).show("slow");
							});
							
							/* edit form cancel buttons */
							$('div.edit input[@type=reset]').click(function(){
								$('div.edit').hide("slow");
							});
							
							/* delete controls */
							$('a.deleteOption').click(function(){
								$('div.container').hide("slow");
								$('#deleteContainer_'+this.id.substr(2)).show("slow");
							});
							
							/* delete form cancel buttons */
							$('div.delete input[@type=reset]').click(function(){
								$('div.delete').hide("slow");
							});
							
							/* integrate controls */
							$('a.integrate').click(function(){
								$('div.container').hide("slow");
								$('#integrateContainer_'+this.id.substr(2)).show("slow");
							});
							
							/* subscribe controls */
							$('a.subscribe').click(function(){
								$('div.container').hide("slow");
								$('#subscribeContainer_'+this.id.substr(2)).show("slow");
							});
						});
					]]>
				</script>
			</head>
			<body>
				<xsl:variable name="dict" select="/data/translation"/>
				<div id="header">
					<div id="organization_name">
						<xsl:value-of select="/data/copName"/>
					</div>

					<img id="logo" src="../../views/img/logo.png"/>
					<a id="header_action" href="/">
						<xsl:value-of select="foo:translate('Back to the portal', $dict)"/>
					</a>

					<div id="control">
						<ul id="user_info">
							<li>
								<xsl:value-of select="/data/username"/>
							</li>
						</ul>
						<ul>
							<xsl:if test="/data/widgetManagement = 'true'">
								<li>
									<a id="administration" href="/admin/main/">
										<xsl:value-of select="foo:translate('Administration', $dict)"/>
									</a>
								</li>
							</xsl:if>
							<li>
								<a id="preferences" href="/portal/preferences/">
									<xsl:value-of select="foo:translate('My preferences', $dict)"/>
								</a>
							</li>
							<li>
								<a id="help" href="../../index.php/help/index">
									<xsl:value-of select="foo:translate('Online help', $dict)"/>
								</a>
							</li>
						</ul>

						<ul>
							<li>
								<a id="logout" href="../../index.php/users/logout">
									<xsl:value-of select="foo:translate('Logout', $dict)"/>
								</a>
							</li>
						</ul>
					</div>
				</div>
				<div id="content">
					<div id="menu_content">
						<ul id="menu">
							<li>
								<a id="menu_widgets" href="/admin/main/">
									<xsl:value-of select="foo:translate('Widgets', $dict)"/>
								</a>
							</li>
							<li>
								<a id="menu_categories" href="/admin/categories/">
									<xsl:value-of select="foo:translate('Categories', $dict)"/>
								</a>
							</li>
							<li>
								<a id="menu_users" href="/admin/users/">
									<xsl:value-of select="foo:translate('Users', $dict)"/>
								</a>
							</li>
							<li>
								<a id="menu_misc" href="/admin/misc/">
									<xsl:value-of select="foo:translate('Miscellaneous', $dict)"/>
								</a>
							</li>
						</ul>
					</div>

					<div id="admin">
						<xsl:if test="/data/error != ''">
							<div id="error">
								<xsl:value-of select="foo:translate(/data/error, $dict)"/>
							</div>
						</xsl:if>
						<xsl:if test="/data/message != ''">
							<div id="message">
								<xsl:value-of select="foo:translate(/data/message, $dict)"/>
							</div>
						</xsl:if>

						<div id="admin_content">
							<xsl:copy-of select="/data/content/*"/>
						</div>
					</div>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>